package com.ssy.lingxi.order.model.vo.process.request;

import com.ssy.lingxi.order.handler.annotation.BigDecimalStringAnnotation;
import com.ssy.lingxi.order.handler.annotation.ManageShopEnvironmentAnnotation;
import com.ssy.lingxi.order.handler.annotation.OrderShopTypeAnnotation;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * 新增交易流程规则接口参数
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-24
 */
public class OrderTradeProcessVO implements Serializable {
    private static final long serialVersionUID = -7020679685784561614L;

    /**
     * 规则名称
     */
    @NotBlank(message = "流程规则名称不能为空")
    @Size(max = 50, message = "流程规则名称最长50个字符")
    private String name;

    /**
     * 适用商城的Id
     */
    @NotNull(message = "适用商城的Id要大于0")
    @Positive(message = "适用商城的Id要大于0")
    private Long shopId;

    /**
     * 适用商城类型
     */
    @NotNull(message = "适用商城类型枚举要大于0")
    @OrderShopTypeAnnotation
    private Integer shopType;

    /**
     * 适用商城的环境
     */
    @NotNull(message = "适用商城环境枚举要大于0")
    @ManageShopEnvironmentAnnotation
    private Integer shopEnvironment;

    /**
     * 基础流程Id
     */
    @NotNull(message = "基础流程Id要大于0")
    @Positive(message = "基础流程Id要大于0")
    private Long baseProcessId;

    /**
     * 订单取消时间，可为空，如基础流程类型是订单交易流程时，不为空则表示设置订单取消时间
     */
    @BigDecimalStringAnnotation(message = "订单取消时间要大于等于0")
    private String expireHours;

    /**
     *是否使用电子合同，ture-是，false-否
     */
    @NotNull(message = "是否使用电子合同不能为空")
    private Boolean hasContract;

    /**
     * 电子合同信息，如使用电子合同不能为空
     */
    @Valid
    private OrderTradeProcessContractVO contract;

    /**
     * 支付配置
     */
    @Valid
    private List<OrderTradeProcessPaymentGroupVO> payments;

    /**
     * 是否适用所有商品，true-是，false-否
     */
    @NotNull(message = "是否所有商品属性不能为空")
    private Boolean allProducts;

    /**
     * 适用商品列表，如不适用所有商品不能为空
     */
    @Valid
    private List<OrderTradeProcessProductVO> products;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Integer getShopType() {
        return shopType;
    }

    public void setShopType(Integer shopType) {
        this.shopType = shopType;
    }

    public Integer getShopEnvironment() {
        return shopEnvironment;
    }

    public void setShopEnvironment(Integer shopEnvironment) {
        this.shopEnvironment = shopEnvironment;
    }

    public Long getBaseProcessId() {
        return baseProcessId;
    }

    public void setBaseProcessId(Long baseProcessId) {
        this.baseProcessId = baseProcessId;
    }

    public String getExpireHours() {
        return expireHours;
    }

    public void setExpireHours(String expireHours) {
        this.expireHours = expireHours;
    }

    public Boolean getHasContract() {
        return hasContract;
    }

    public void setHasContract(Boolean hasContract) {
        this.hasContract = hasContract;
    }

    public OrderTradeProcessContractVO getContract() {
        return contract;
    }

    public void setContract(OrderTradeProcessContractVO contract) {
        this.contract = contract;
    }

    public List<OrderTradeProcessPaymentGroupVO> getPayments() {
        return payments;
    }

    public void setPayments(List<OrderTradeProcessPaymentGroupVO> payments) {
        this.payments = payments;
    }

    public Boolean getAllProducts() {
        return allProducts;
    }

    public void setAllProducts(Boolean allProducts) {
        this.allProducts = allProducts;
    }

    public List<OrderTradeProcessProductVO> getProducts() {
        return products;
    }

    public void setProducts(List<OrderTradeProcessProductVO> products) {
        this.products = products;
    }
}
